package com.hzbank.generate.controller;

import com.hzbank.generate.entity.PmChnlInfo;
import com.hzbank.generate.service.EntityService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.HashMap;
import java.util.Map;

@Slf4j
@Controller
@RequestMapping("/entity")
public class EntityController {
    @Autowired
    private EntityService entityService;

    @GetMapping("/chnl")
    @ResponseBody
    public Map<String,Object> one(){
        Map<String,Object> map = new HashMap<>();
        PmChnlInfo pmChnlInfo = entityService.selectOnePmChnlInfo();
        map.put("chnlCode",pmChnlInfo.getChnlCode());
        return map;
    }

    @GetMapping("insert1")
    @ResponseBody
    public Integer insertPmChnlInfo(){

        int i = entityService.insertPmChnlInfo();
        return i;

    }




}
